package cn.edu.neusoft.demo.hospital2.Dao;

import cn.edu.neusoft.demo.hospital2.pojo.Messageboard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageboardDao extends BaseMapper<Messageboard> {
    List<Messageboard> getMessageList();
    List<Messageboard> selectById(Integer userId); // 返回 List
    int insert(Messageboard messageboard);
    int updateById(Messageboard messageboard);
    int deleteById(Integer messageId);

    @Select("SELECT * FROM message_board WHERE appointment_id = #{appointmentId}")
    List<Messageboard> findByAppointmentId(@Param("appointmentId") Integer appointmentId);
}
